package javao.cn.modules.index;

import javao.cn.common.utils.PageUtils;
import javao.cn.common.utils.R;
import javao.cn.modules.business.service.SysLunboService;
import javao.cn.modules.sys.service.SysAnnouncementsService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Description 前台开放接口
 * @Author
 * @Date 2024/12/4
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private SysLunboService sysLunboService;

    @Autowired
    private SysAnnouncementsService sysAnnouncementsService;

    /**
     * 首页轮播图列表
     */
    @RequestMapping("/lunboList")
    public R lunboList(@RequestParam Map<String, Object> params){
        PageUtils page = sysLunboService.queryPageByDesc(params);
        return R.ok().put("page", page);
    }

    /**
     * 列表
     */
    @RequestMapping("/announcementsList")
    public R announcementsList(@RequestParam Map<String, Object> params){
        PageUtils page = sysAnnouncementsService.queryPage(params);
        return R.ok().put("page", page);
    }


}
